package com.lynx.core.util;

import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
/**
 * 
 * @author lxp
 *
 */
public class PushBeanUtils {
	
	public static void push(Map results,Object obj){
		try {
			List<Field> lists = BeanUtils.getField(obj);
			for (Field field : lists) {
				String  propertyName = field.getName();
				if (results.containsKey(propertyName)) {
					Object newValue = results.get(propertyName);
					BeanUtils.setProperty(obj, propertyName, newValue);
				}
			}
		} catch (Exception e) {
			System.out.println(e.toString());
		}
	}

}
